package com.whmall.service.crm.provider;

import com.whmall.service.crm.api.CompanyBusinessCertificateApi;
import com.whmall.service.crm.entity.dto.companybusinesscertificate.*;
import com.whmall.service.crm.module.companybusinesscertificate.service.CompanyBusinessCertificateService;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.List;

/**
 * Author：yangdong
 * Date：2020/8/3
 * Description：经营证件API实现
 */
@RequiredArgsConstructor
@DubboService(interfaceClass = CompanyBusinessCertificateApi.class)
public class CompanyBusinessCertificateProvider implements CompanyBusinessCertificateApi {

    private final CompanyBusinessCertificateService certificateService;

    @Override
    public List<CompanyBusinessCertificateRspDTO> listBy(CompanyBusinessCertificateQueryReqDTO queryReqDTO) {
        return certificateService.listBy(queryReqDTO);
    }

    @Override
    public List<CompanyBusinessCertificateDTO> listBy(CompanyBusinessCertificateListQO qo) {
        return certificateService.listBy(qo);
    }

    @Override
    public CompanyBusinessCertificateRspDTO getById(Long id) {
        return certificateService.getById(id);
    }

    @Override
    public void insert(SaveCompanyBusinessCertificateReqDTO businessCertificateReqDTO) {
        certificateService.insert(businessCertificateReqDTO);
    }

    @Override
    public void update(SaveCompanyBusinessCertificateReqDTO businessCertificateReqDTO) {
        certificateService.update(businessCertificateReqDTO);
    }

    @Override
    public int delete(Long id, Integer operatorType, Long operatorId) {
        return certificateService.delete(id, operatorType, operatorId);
    }

    @Override
    public int countEffective(Long id, Long companyId, String certificateNumber) {
        return certificateService.countEffective(id, companyId, certificateNumber);
    }

    @Override
    public void revalidateEffective() {
        certificateService.revalidateEffective();
    }

    @Override
    public Boolean isExistsValidProduct(Long id) {
        return certificateService.isExistsValidProduct(id);
    }
}
